home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / dejagnu.lha / dejagnu-1.0.1 / expect / Makefile.in < prev    next >
Makefile  |  1993-05-26  |  15KB  |  395 lines

  1. #
  2. # Makefile for Expect
  3. #
  4.  
  5. VERSION = \"4.5.2\"
  6. SHORT_VERSION = 4.5
  7. # Requires following version of Tcl or later
  8. TCL = 6.5
  9. # Tk optional
  10. TK = 3.0
  11.  
  12. srcdir     = @srcdir@
  13. VPATH = @srcdir@
  14.  
  15. ######################################################################
  16. # The following lines are things you are likely to want to change
  17. ######################################################################
  18.  
  19. # Tcl include files.  (If you haven't installed Tcl yet, read the README file).
  20. # This must point to the directory that contains ALL of Tcl's include
  21. # files, not just the public ones.
  22. TCLHDIR = $(srcdir)/../tcl
  23. # Tcl library
  24. TCLLIB = ../tcl/libtcl.a
  25.  
  26. # The following three defs are only nec. if you want to use Tk with Expect.
  27. # Tk include files
  28. TKHDIR = $(srcdir)/../tk
  29. # Tk library
  30. TKLIB = ../tk/libtk.a
  31. # X11 include files
  32. X11HDIR = $(srcdir)/../X11
  33.  
  34. # flags to pass to both cc and ld
  35. # -O for production version
  36. # -g for debuggable version
  37. CFLAGS = -g
  38.  
  39. # which C compiler to use
  40. CC = cc
  41.  
  42. # By default, `make install' will install the appropriate files in
  43. # /usr/local/bin, /usr/local/lib, /usr/local/man, etc.  You can specify
  44. # an installation prefix other than /usr/local here:
  45. prefix         = /usr/local
  46.  
  47. # You can specify a separate installation prefix for architecture-specific
  48. # files such as binaries and libraries.
  49. exec_prefix     = /usr/local
  50.  
  51. # The following Expect scripts are not necessary to have installed as
  52. # commands, but are very useful.  Edit out what you don't want installed.
  53. # The INSTALL file describes these and others in more detail.
  54. # Some Make's screw up if you delete all of them because SCRIPTS is a
  55. # target.  If this is a problem, just comment out the SCRIPTS target itself.
  56. SCRIPTS = timed-run timed-read ftp-rfc autopasswd robohunt lpunlock weather \
  57.     passmass rftp kibitz rlogin-cwd xpstat
  58. # A couple (well, one for now) of the scripts have man pages of their own.
  59. # You can delete these too, if you don't want'em.
  60. SCRIPTS_MANPAGES = kibitz
  61.  
  62. # Short directory path where expect binary can be found to support #! hack.
  63. # This directory path can be the same as the directory in which the binary
  64. # actually sits except when the path is so long that the #! mechanism breaks
  65. # (usually at 32 characters).
  66. # The solution is to create a directory with a very short name, which consists
  67. # only of symbolic links back to the true binaries.  Subtracting two for "#!"
  68. # and a couple more for arguments (typically " -f" or " --") gives you 27
  69. # characters.  Pathnames over this length won't be able to use the #! magic.
  70. # For more info on this, see the execve(2) man page.
  71. SHORT_BINDIR = /usr/local/bin
  72.  
  73. # If you have select but it doesn't support ttys and your poll does,
  74. # change this from select to poll.  Known systems with this problem: older
  75. # SCO boxes.
  76. PTY_TYPE = @PTY_TYPE@
  77.  
  78. # If you have ranlib but it should be avoided, change this from "ranlib" #
  79. # to something innocuous like "echo".  Known systems with this problem:
  80. # older SCO boxes.
  81. RANLIB = @RANLIB@
  82.  
  83. ######################################################################
  84. # End of things you are likely to want to change
  85. ######################################################################
  86.  
  87. bindir     = $(exec_prefix)/bin
  88. bindir_arch_indep = $(prefix)/bin
  89. libdir     = $(exec_prefix)/lib
  90. tooldir = $(libdir)
  91. datadir = $(prefix)/lib
  92.  
  93. mandir     = $(prefix)/man
  94. man1dir = $(mandir)/man1
  95. man3dir = $(mandir)/man3
  96. infodir = $(prefix)/info
  97. includedir = $(prefix)/include
  98. oldincludedir =
  99. docdir = $(datadir)/doc
  100.  
  101. SHELL = /bin/sh
  102.  
  103. INSTALL = @INSTALL@
  104. INSTALL_PROGRAM = @INSTALL@
  105. INSTALL_DATA = @INSTALL_DATA@
  106.  
  107. AR = ar
  108. ARFLAGS = cr
  109.  
  110. RUNTEST = runtest
  111. RUNTESTFLAGS =
  112.  
  113. # X library
  114. X11_LIB_FLAGS=
  115. X11_LIB = -lX11
  116.  
  117. # If you are on a cray, comment out the "SETUID = echo" line and use the
  118. # "SETUID = chmod s+o" below.  expect must be setuid on crays in order to
  119. # open ptys (and accordingly, you must run this Makefile as root).
  120. # See the FAQ for more info on why this is necessary on Crays.
  121. SETUID = @SETUID@
  122. # SETUID = chmod u+s
  123. #
  124. # choose one of the following: select, poll, posix, or simple
  125. EVENT_TYPE = @EVENT_TYPE@
  126. # If your system (Sun, recent HP, Ultrix, etc) has select(2) use select
  127. # Note that many SV machines support select.  Starting with SVR4, all will.
  128. # If your machine supports poll(2) but not select, use poll.
  129. # If that doesn't work, use simple.  This does not support
  130. # multiple processes, but you will still find the result useful.
  131. # Some machines (e.g., 3b2 running SVR3) have poll, but do not
  132. # support it for ttys.  In this case, you must also use simple.
  133. # Eventually, POSIX is supposed to provide a select/poll replacement,
  134. # but they have not yet done so.
  135. # Some machines (e.g., SCO) have select, but do not support it for ttys.
  136. # In this case, use poll or simple.  Note that such machines will not
  137. # be able to use Expect with Tk since Tk's event manager insists on
  138. # reading all events through select.
  139. SCRIPTDIR    = $(datadir)/expect
  140.  
  141. # Define default parameters for ptys.  This is used when 1) running in the
  142. # background, 2) user has not defined the variable STTY_INIT to initialize
  143. # ptys, and 3) the pty-driver's defaults suck.
  144. # Use whatever format your local stty program likes.  
  145. STTY=\"sane\"
  146.  
  147. CPPFLAGS =    -I. -I$(srcdir) -I$(TCLHDIR) -I$(TKHDIR) -I$(X11HDIR) \
  148.         -DVERSION=$(VERSION) \
  149.         -DDFLT_STTY=$(STTY) \
  150.         -DSCRIPTDIR=\"$(SCRIPTDIR)/\"
  151.  
  152. #
  153. # Flags to pass to cc (i.e. add to the end of the CFLAGS line below).
  154. # Note that setting one will not set others automatically.  Set all that
  155. # are relevant.
  156. # -DPOSIX if you are have POSIX tty support.  (Currently only tested on AIX
  157. #    3.x).  
  158. # -DNOWAITPID if your system doesn't have waitpid.  Only really old systems
  159. #    lack this.
  160. # -DNO_PID_T if your system doesn't have a typedef for pid_t.  If you don't
  161. #    know, try without defining it.  If it compiles, you're ok.
  162. # -DNO_MEMCPY if your system does not have memcpy.  If you don't know, try
  163. #    without defining it.  If it compiles, you're ok.
  164. # -DNO_STRING_H if your system does not have /usr/include/string.h.  If you
  165. #    don't know, try without defining it.  If it compiles, you're ok.
  166. # -DSYSV3 if you are running SVR3 or later.
  167. # -DSYSV4 if you are running SVR4.  This option does not preclude -DSYSV3.
  168. # -DHPUX if you are running HP-UX.
  169. # -DCRAY=51 or 60, 70, etc, if you are running Cray Unicos 5.1, 6.0, 7.0, etc.
  170. # -DAUX2 if you are running Mac A/UX 2.
  171. # -DUTS if you are on an Amdahl.
  172. # -DSCO if you are running SCO Unix.
  173. # -DMIPS_BSD if you are on a Mips machine using the BSD universe.
  174. # -DRETSIGTYPE=int if you are running SunOS-3.X or similar systems that
  175. #    define the function argument to signal as int (*func)() rather than
  176. #    void (*func)().
  177. # -DREARM_SIG if you are running systems (such as V7, SV, Unicos) where signal
  178. #    handlers need to be rearmed after use.
  179. # -D_BSD_SIGNALS if you are on a Silicon Graphics AND want BSD semantics when
  180. #    using the expect library.  Otherwise, you are better off just sticking
  181. #    with defining REARM_SIG (above).
  182. # -DEXTERN_ERRNO if your system needs "extern int errno" (e.g., MORE/bsd).
  183. # -DTERM=whatever if your system is unhappy with the default terminal struct
  184. #    name (termios for SV, and sgttyb for BSD).  Some SV systems (3b2 &
  185. #    pre-8.0 HPUX) want "termio".
  186. # -DNOSTDLIB if your system doesn't have /usr/include/stdlib.h.  If you don't
  187. #    know, try without.  If you get bad declarations on malloc, then add.
  188.  
  189. # Flags to pass to ld (i.e., add to the end of the LIBS line below).
  190. #
  191. # -lc -lBSD     If you are using the BSD compatibility library on an HP/UX,
  192. #        force libc.a to be loaded first.
  193. # -lsocket    For SCO UNIX 3.2.2
  194. #  /usr/ucblib/libucb.a is needed for solaris 2.0 after -lm
  195. LIBS = -lm @LIBS@
  196.  
  197. ######################################################################
  198. # End of things you probably dont want to change
  199. ######################################################################
  200.  
  201. # If your "make" automatically includes CPPFLAGS in CC, use
  202. #CFLAGS = $(CLFLAGS)
  203. # else use following two lines 
  204. # use these flags on an HP700 running hp-ux
  205. #CFLAGS = $(CLFLAGS) $(CPPFLAGS) -DHPUX -DSYSV3 -DREARM_SIG
  206. CFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(CFLAGS)
  207.  
  208. .c.o:
  209.     $(CC) -c $(CFLAGS_INT) $(HDEFS) $<
  210.  
  211. EVENT = exp_$(EVENT_TYPE)
  212. PTY = pty_$(PTY_TYPE)
  213. CFILES = $(srcdir)/exp_command.c $(srcdir)/expect.c $(srcdir)/$(PTY).c \
  214.     $(srcdir)/exp_inter.c $(srcdir)/exp_regexp.c $(srcdir)/exp_tty.c \
  215.     $(srcdir)/exp_log.c $(srcdir)/exp_main_sub.c $(srcdir)/exp_pty.c
  216. OFILES = exp_command.o expect.o $(PTY).o exp_inter.o exp_regexp.o exp_tty.o \
  217.     exp_log.o exp_main_sub.o exp_pty.o
  218. LIBCFILES = $(srcdir)/lib_exp.c $(srcdir)/lib_string.c $(srcdir)/$(PTY).c \
  219.     $(srcdir)/lib_debug.c $(srcdir)/exp_pty.c
  220. LIBOFILES = lib_exp.o lib_string.o $(PTY).o lib_debug.o exp_pty.o
  221. LIBEXPECT = libexpect.a
  222. LIBEXPTCL = libexptcl.a
  223. LIBEXPTK  = libexptk.a
  224.  
  225. # CYGNUS LOCAL: don't build tk stuff for now...
  226. all: expect $(LIBEXPECT) $(LIBEXPTCL) exp_test #$expectk (LIBEXPTK)
  227.  
  228. info:
  229. dvi:
  230.  
  231. expect:    $(OFILES) exp_main_exp.o $(EVENT).o
  232.     $(CC) $(CFLAGS) -o expect $(OFILES) exp_main_exp.o $(EVENT).o $(LIBS) $(TCLLIB)
  233.     $(SETUID) expect
  234.  
  235. expectk:        $(OFILES) exp_main_tk.o exp_tk.o
  236.     $(CC) $(CLFLAGS) -o expectk $(OFILES) exp_main_tk.o exp_tk.o $(TKLIB) $(TCLLIB) $(X11_LIB_FLAGS) $(X11_LIB) $(LIBS) 
  237.     $(SETUID) expectk
  238.  
  239. exp_test: $(srcdir)/exp_test.c
  240.     $(CC) $(CFLAGS) $(srcdir)/exp_test.c -o exp_test
  241.  
  242. Makefile : $(srcdir)/Makefile.in $(host_makefile_frag)
  243.     $(SHELL) config.status
  244.  
  245. $(LIBEXPECT): $(LIBOFILES)
  246.     $(AR) $(ARFLAGS) $(LIBEXPECT) $(LIBOFILES)
  247.     -$(RANLIB) $(LIBEXPECT)
  248.  
  249. $(LIBEXPTCL): $(OFILES) $(EVENT).o
  250.     $(AR) $(ARFLAGS) $(LIBEXPTCL) $(OFILES) $(EVENT).o
  251.     -$(RANLIB) $(LIBEXPTCL)
  252.  
  253. $(LIBEXPTK): $(OFILES) exp_tk.o
  254.     $(AR) $(ARFLAGS) $(LIBEXPTK) $(OFILES) exp_tk.o
  255.     -$(RANLIB) $(LIBEXPTK)
  256.  
  257. install-info:
  258. # CYGNUS LOCAL: don't depend on $(SCRIPTS)
  259. install:    expect $(LIBEXPECT) # $(SCRIPTS)
  260.  
  261. # install Expect
  262.     -parent=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \
  263.     if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
  264.     -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi
  265.     $(INSTALL_PROGRAM) expect $(bindir)/expect
  266. # install Expect man page
  267.     -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \
  268.     if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
  269.     -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi
  270.     $(INSTALL_DATA) $(srcdir)/expect.man $(man1dir)/expect.1
  271. # install Expect library
  272.     -parent=`echo $(libdir)|sed -e 's@/[^/]*$$@@'`; \
  273.     if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
  274.     -if [ -d $(libdir) ] ; then true ; else mkdir $(libdir) ; fi
  275.     $(INSTALL_DATA) libexpect.a $(libdir)/libexpect.a.n
  276.     -$(RANLIB) $(libdir)/libexpect.a.n
  277.     mv -f $(libdir)/libexpect.a.n $(libdir)/libexpect.a
  278. # install Expect library man page
  279.     -parent=`echo $(man3dir)|sed -e 's@/[^/]*$$@@'`; \
  280.     if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
  281.     -if [ -d $(man3dir) ] ; then true ; else mkdir $(man3dir) ; fi
  282.     $(INSTALL_DATA) $(srcdir)/libexpect.man $(man3dir)/libexpect.3
  283. # install Expect library include file
  284.     -parent=`echo $(includedir)|sed -e 's@/[^/]*$$@@'`; \
  285.     if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
  286.     -if [ -d $(includedir) ] ; then true ; else mkdir $(includedir) ; fi
  287.     $(INSTALL_DATA) $(srcdir)/expect.h $(includedir)/expect.h
  288. # ditto but for Expect-Tcl library if present
  289.     -if [ -s $(LIBEXPTCL) ] ; then \
  290.         $(INSTALL_DATA) $(LIBEXPTCL) $(libdir)/$(LIBEXPTCL).n ; \
  291.         $(RANLIB) $(libdir)/$(LIBEXPTCL).n 2>>/dev/null ; \
  292.         mv -f $(libdir)/$(LIBEXPTCL).n $(libdir)/$(LIBEXPTCL) ; \
  293.         $(INSTALL_DATA) $(srcdir)/libexptcl.man $(man3dir)/libexptcl.3 ; \
  294.     fi
  295. # ditto but for Expectk
  296.     -if [ -x expectk ] ; then \
  297.         $(INSTALL_PROGRAM) expectk $(bindir)/expectk ; \
  298.     fi
  299. # ditto but for Expect-Tk library if present
  300.     -if [ -s $(LIBEXPTK) ] ; then \
  301.         $(INSTALL_DATA) $(LIBEXPTK) $(libdir)/$(LIBEXPTK).n ; \
  302.         $(RANLIB) $(libdir)/$(LIBEXPTK).n 2>>/dev/null ; \
  303.         mv -f $(libdir)/$(LIBEXPTK).n $(libdir)/$(LIBEXPTK) ; \
  304.         $(INSTALL_DATA) $(srcdir)/libexptk.man $(man3dir)/libexptk.3 ; \
  305.     fi
  306. # create utility-script directory
  307.     -parent=`echo $(SCRIPTDIR)|sed -e 's@/[^/]*$$@@'`; \
  308.     if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi
  309.     -if [ -d $(SCRIPTDIR) ] ; then true ; else mkdir $(SCRIPTDIR) ; fi
  310. # install standalone scripts and their man pages, if requested
  311.     -if [ -n "$(SCRIPTS)" ] ; then \
  312.         for i in $(SCRIPTS) ; do \
  313.           if [ -f $$i ] ; then \
  314.             $(INSTALL_PROGRAM) $$i $(bindir_arch_indep)/$$i ; \
  315.             chmod a+x $(bindir_arch_indep)/$$i ; \
  316.             rm $$i ; \
  317.           fi \
  318.         done ; \
  319.     fi
  320.     -if [ -n "$(SCRIPTS_MANPAGES)" ]; then \
  321.         for file in "$(SCRIPTS_MANPAGES)" ; do \
  322.           if [ -f $$file ] ; then \
  323.             $(INSTALL_DATA) $(srcdir)/example/$$file.man $(man1dir)/$$file.1 ; \
  324.           fi ; \
  325.         done ; \
  326.     fi
  327.  
  328. $(SCRIPTS):
  329.     ./expect $(srcdir)/fixline1 $(SHORT_BINDIR) < $(srcdir)/example/$@ > $@
  330. #    ./expect fixline1 $(SHORT_BINDIR) < example/$@ > $@
  331.  
  332. clean:
  333.     -rm -f *~ *.o core expect expectk dumb exho devtty *.a exp_test
  334.  
  335. check:    all exp_test
  336.     rootme=`pwd`; export rootme; \
  337.     $(RUNTEST) $(RUNTESTFLAGS) --tool expect EXPECT=$$rootme/expect \
  338.         --srcdir $(srcdir)/testsuite
  339.  
  340. distclean: clean
  341.     -rm -f Makefile config.status exp_conf.h
  342.  
  343. configure: configure.in
  344.     autoconf configure.in > configure
  345.  
  346. LINTFLAGS = -h -q -x 
  347.  
  348. lint:
  349.     lint $(LINTFLAGS) $(CPPFLAGS) $(CFILES) $(TCLLINTLIB) | tee expect.lint
  350.     lint $(LINTFLAGS) $(CPPFLAGS) $(LIBCFILES) | tee libexpect.lint
  351.  
  352. # Following target builds expect under CodeCenter.
  353. exp:    $(CFILES) exp_main_exp.c $(EVENT).c
  354.     #load $(CPPFLAGS) $(CFILES) exp_main_exp.c $(EVENT).c $(TCLLIB) $(LIBS)
  355.  
  356. # Following target builds expectk under CodeCenter.  Notes:
  357. # Because of explicit #includes of <X11/...> in tk.h, you need to create
  358. # a symlink from your X11 include directory to this directory
  359. tk:     $(CFILES) exp_main_tk.c exp_tk.c
  360.     #load $(CPPFLAGS) $(CFILES) exp_main_tk.c exp_tk.c $(TKLIB) $(TCLLIB) $(X11_LIB) $(LIBS)
  361.  
  362. # Follow definitions are for building expect and expectk under ObjectCenter
  363. oexp:   $(CFILES) exp_main_exp.c $(EVENT).c
  364.     #load $(CPPFLAGS) -C $(CFILES) exp_main_exp.c $(EVENT).c $(TCLLIB)
  365.  
  366. otk:    $(CFILES) exp_main_tk.c exp_tk.c
  367.     #load $(CPPFLAGS) -C $(CFILES) exp_main_tk.c exp_tk.c $(TKLIB)
  368.  
  369. FTPDIR = /proj/elib/online/pub/expect
  370.  
  371. ftp:    expect-$(SHORT_VERSION).tar.Z
  372.     cp expect-$(SHORT_VERSION).tar.Z $(FTPDIR)/alpha.tar.Z
  373.     cp HISTORY $(FTPDIR)
  374.     rm expect-$(SHORT_VERSION).tar.Z
  375.     ls -l $(FTPDIR)/alpha.tar.Z
  376.  
  377. expect-$(SHORT_VERSION).tar:
  378.     rm -f ../expect-$(SHORT_VERSION)
  379.     ln -s `pwd` ../expect-$(SHORT_VERSION)
  380.     rm -f ../pubfile
  381.     ln pubfile ..
  382.     cd ..;tar cvf expect-$(SHORT_VERSION).tar `pubfile expect-$(SHORT_VERSION)`
  383.     mv ../expect-$(SHORT_VERSION).tar .
  384.  
  385. expect-$(SHORT_VERSION).tar.Z:    expect-$(SHORT_VERSION).tar
  386.     rm -f expect-$(SHORT_VERSION).tar.Z
  387.     compress expect-$(SHORT_VERSION).tar
  388.  
  389. expect.o:    $(srcdir)/exp_global.h $(srcdir)/exp_command.h exp_conf.h
  390. exp_main_exp.o:    $(srcdir)/exp_global.h exp_conf.h
  391. exp_command.o:    $(srcdir)/exp_global.h $(srcdir)/exp_command.h exp_conf.h
  392. $(EVENT).o:    $(srcdir)/exp_global.h $(srcdir)/exp_command.h exp_conf.h
  393. $(PTY).o:    $(srcdir)/exp_tty.h $(srcdir)/exp_rename.h exp_conf.h
  394.